package com.dkf.controller;

import com.dkf.service.SaleplanparaService;
import com.lww.springcloudapi.entity.TabSaleplanpara;
import com.lww.springcloudapi.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/yxhd")
@RestController
@Api(tags = "营销活动信息")
@CrossOrigin
public class SaleplanparaController {
    @Autowired
    private SaleplanparaService service;

    @PostMapping("list/{b}/{current}/{size}")
    @ApiOperation("营销活动信息查询")
    public Result findSaleplanparaPage(@PathVariable boolean b,@PathVariable long current,@PathVariable long size){
        return service.findSaleplanparaPage(b, current, size);
    }

    @PostMapping("updata")
    @ApiOperation("营销活动信息修改")
    public Result updataSaleplanparaPage(@RequestBody TabSaleplanpara tabSaleplanpara){
        return service.updataSaleplanpara(tabSaleplanpara);
    }

    @PostMapping("add")
    @ApiOperation("营销活动信息添加")
    public Result addSaleplanparaPage(@RequestBody TabSaleplanpara tabSaleplanpara){
        return service.addSaleplanpara(tabSaleplanpara);
    }

    @DeleteMapping("delete")
    @ApiOperation("营销活动信息删除")
    public Result deleteSaleplanparaPage(Integer id){
        return service.deleteSaleplanpara(id);
    }

}
